class RroutesController < ApplicationController
  # GET /rroutes
  # GET /rroutes.xml
  def index
    @rroutes = Rroute.find(:all)

    respond_to do |format|
      format.html # index.rhtml
      format.xml  { render :xml => @rroutes.to_xml }
    end
  end

  # GET /rroutes/1
  # GET /rroutes/1.xml
  def show
    @rroute = Rroute.find(params[:id])

    respond_to do |format|
      format.html # show.rhtml
      format.xml  { render :xml => @rroute.to_xml }
    end
  end

  # GET /rroutes/new
  def new
    @rroute = Rroute.new
  end

  # GET /rroutes/1;edit
  def edit
    @rroute = Rroute.find(params[:id])
  end

  # POST /rroutes
  # POST /rroutes.xml
  def create
    @rroute = Rroute.new(params[:rroute])

    respond_to do |format|
      if @rroute.save
        flash[:notice] = 'Rroute was successfully created.'
        format.html { redirect_to rroute_url(@rroute) }
        format.xml  { head :created, :location => rroute_url(@rroute) }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @rroute.errors.to_xml }
      end
    end
  end

  # PUT /rroutes/1
  # PUT /rroutes/1.xml
  def update
    @rroute = Rroute.find(params[:id])

    respond_to do |format|
      if @rroute.update_attributes(params[:rroute])
        flash[:notice] = 'Rroute was successfully updated.'
        format.html { redirect_to rroute_url(@rroute) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @rroute.errors.to_xml }
      end
    end
  end

  # DELETE /rroutes/1
  # DELETE /rroutes/1.xml
  def destroy
    @rroute = Rroute.find(params[:id])
    @rroute.destroy

    respond_to do |format|
      format.html { redirect_to rroutes_url }
      format.xml  { head :ok }
    end
  end
end
